﻿using Sundry.IBLL;
using Sundry.Model;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using System.Text;
using System.Threading.Tasks;

namespace Sundry.BLL
{
    public class AdminLoginLogService:BaseService<AdminLoginLog>,IAdminLoginLogService
    {
        public override void SetCurrentRepository()
        {
            CurrentRepository = _dbSession.AdminLoginLogRepository;
        }

        public int AddEntity(AdminLoginLog entity, Admin admin)
        {
            var addEntuty = _dbSession.AdminLoginLogRepository.AddEntity(entity, admin);
            return _dbSession.SaveChange();
        }
        /// <summary>
        /// 用户登录日志列表
        /// </summary>
        /// <param name="userName">用户名</param>
        /// <param name="nowNumber">当前数字</param>
        /// <param name="pageSize">长度</param>
        /// <param name="rowCount">总行数</param>
        /// <returns>用户登录日志列表</returns>
        public IQueryable<dynamic> LoadLogList(string userName, int nowNumber, int pageSize, out int rowCount)
        {
            return _dbSession.AdminLoginLogRepository.LoadLogList(userName, nowNumber, pageSize, out rowCount);
        }
    }
}
